package model;

public class OfferedCourseCanceledState implements OfferedCourseState{

private OfferedCourse offeredCourse;
	
	public OfferedCourseCanceledState(OfferedCourse offeredCourse){
		this.offeredCourse = offeredCourse;
	}
	
	@Override
	public boolean registerStudent(Registration registration) throws Exception {
		throw new Exception("Sorry course has been canceled.");
		
	}

	@Override
	public void unregisterStudent(Registration registration) throws Exception {
		throw new Exception("Sorry course has been canceled.");
		
	}

	@Override
	public void closeRegistration() throws Exception {
		throw new Exception("Sorry course has been canceled.");
		
	}

	@Override
	public void cancelOfferedCourse() throws Exception {
		throw new Exception("Sorry course has already been canceled.");
		
	}
	
	@Override
	public String toString(){
		return model.enums.OfferedCourseState.CANCELED.toString();
	}

}
